﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BneyBaruch.Ingest.MorningLesson.Services;
using BneyBaruch.Ingest.MorningLesson.Services.Data;

namespace BneyBaruch.Ingest.MorningLesson.WorkflowCommunication.RecordingController
{
    public class RecordingControllerCallback : IRecordingControllerCallback
    {
        #region Fields

        private readonly IRecordingControllerExchangeService recordingControllerExchangeService;

        #endregion

        #region Constructors

        public RecordingControllerCallback(IRecordingControllerExchangeService recordingControllerExchangeService)
        {
            if (recordingControllerExchangeService == null)
                throw new ArgumentNullException("recordingControllerExchangeService");

            this.recordingControllerExchangeService = recordingControllerExchangeService;
        }

        #endregion

        #region IRecordingControllerCallback Members

        public void ApproveMatrixAdjustment(MatrixAdjustmentApprovalStatus matrixAdjustmentApprovalStatus)
        {
            recordingControllerExchangeService.NotifyMatrixAdjustmentApproved(matrixAdjustmentApprovalStatus.WorkflowInstanceId);
        }

        public void ReportFileSystemStatus(FileSystemStatus fileSystemStatus)
        {
            recordingControllerExchangeService.NotifyFileSystemBeforeRecordingCommandCompletedOnRecordingController(fileSystemStatus.WorkflowInstanceId);
        }

        #endregion
    }
}
